package com.idak.rdv.web.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.idak.rdv.db.Appointment;
import com.idak.rdv.service.AppointmentService;

@Controller
public class AppointmentController {
	
	@Autowired
	private AppointmentService appointmentService;
	
	@RequestMapping("appointment")
	public String appointmentList(Model model){
		List<Appointment> appointments = appointmentService.getAllAppointments();		
		model.addAttribute("appointments", appointments);
		return "appointment";
	}
}
